package com.tanhua.model.vo;

import com.tanhua.model.domain.UserInfo;
import com.tanhua.model.mongo.FocusUser;
import com.tanhua.model.mongo.Friend;
import com.tanhua.model.mongo.UserLike;
import com.tanhua.model.mongo.Visitors;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.beans.BeanUtils;

import java.io.Serializable;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class UserInfoPlusVo implements Serializable {

    private Long id; //用户id
    private String nickname; //昵称
    private String avatar; //用户头像
    private String birthday; //生日
    private String gender; //性别
    private Integer age; //年龄
    private String city; //城市
    private String income; //收入
    private String education; //学历
    private String profession; //行业
    private Integer marriage; //婚姻状态

    private Integer matchRate ; //匹配度
    private Boolean alreadyLove ; //是否喜欢ta


    public static UserInfoPlusVo init(UserInfo userInfo) {
        UserInfoPlusVo vo = new UserInfoPlusVo();
        BeanUtils.copyProperties(userInfo, vo);
        vo.setMatchRate(80);
        return vo;
    }

    public static UserInfoPlusVo initFriend(UserInfo userInfo, Friend item) {
        UserInfoPlusVo vo = new UserInfoPlusVo();
        BeanUtils.copyProperties(userInfo, vo);
        BeanUtils.copyProperties(item, vo);
        vo.setMatchRate(80);
        vo.setAlreadyLove(true);
        return vo;
    }
    public static UserInfoPlusVo initUserLike(UserInfo userInfo, UserLike item) {
        UserInfoPlusVo vo = new UserInfoPlusVo();
        BeanUtils.copyProperties(userInfo, vo);
        BeanUtils.copyProperties(item, vo);
        vo.setMatchRate(80);
        vo.setAlreadyLove(true);
        return vo;
    }
    public static UserInfoPlusVo initFocusUser(UserInfo userInfo, FocusUser item) {
        UserInfoPlusVo vo = new UserInfoPlusVo();
        BeanUtils.copyProperties(userInfo, vo);
        BeanUtils.copyProperties(item, vo);
        vo.setMatchRate(80);
        vo.setAlreadyLove(false);
        return vo;
    }

    public static UserInfoPlusVo initVistors(UserInfo userInfo, Visitors item) {
        UserInfoPlusVo vo = new UserInfoPlusVo();
        BeanUtils.copyProperties(userInfo, vo);
        BeanUtils.copyProperties(item, vo);
        vo.setMatchRate(80);
        vo.setAlreadyLove(true);
        return vo;
    }


}